#include <math.h>
#include <stdio.h>

const unsigned int kNumFactorials = 8192;

int main(int argc, char** argv)
{
  double fact = 0.0;
  unsigned int curFactorial;

  printf("#include <stdlib.h>\n");
  printf("float gLogFact[%u] = {%lE,\n", kNumFactorials, fact);

  for(curFactorial = 1; curFactorial < kNumFactorials - 1; curFactorial++)
  {
    fact += log((double)curFactorial);

    printf("                      %lE,\n", fact);
  }

  fact += log((double)(curFactorial + 1));
  printf("                      %lE};\n", fact);
  printf("size_t gNumFactorials = %u;\n", kNumFactorials);
}

